package ch4;

class BirthDate {
	int day;
	int month;
	int year;

	public BirthDate(int d, int m, int y) {
		day = d;
		month = m;
		year = y;
	}

	public int getDay() {
		return day;
	}

	public void setDay(int day) {
		this.day = day;
	}

	public int getMonth() {
		return month;
	}

	public void setMonth(int month) {
		this.month = month;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public void display() {
		System.out.println("Birthdate is year: " + year + ", month: " + month + ", day: " + day);
	}
}

public class TestBD {

	public void change1(int i) {
		i = 12345;
	}

	public void change2(BirthDate b) {
		b = new BirthDate(3, 17, 2020);
	}

	public void change3(BirthDate b) {
		b.setDay(19);
	}

	public static void main(String[] args) {
		TestBD test = new TestBD();
		int date = 1;
		BirthDate d1 = new BirthDate(1, 1, 2019);
		BirthDate d2 = new BirthDate(3, 3, 2020);
		test.change1(date);
		test.change2(d1);
		test.change3(d2);
		System.out.println("date=" + date);
		d1.display();
		d2.display();
	}
}
